program task1_restrict;

function restrict (X:integer):integer;
begin
if X>255 then X:=255;
if X<0 then X:=0;
restrict:=X;
end;

begin
Writeln(restrict(-15));
Writeln(restrict(37));
Writeln(restrict(1000));
end.